home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbnws102.zip / GRAPHSPK.ZIP / SCR9BITS.BAS < prev   
BASIC Source File  |  1989-12-28  |  2KB  |  66 lines

  1. '======================= SCR9BITS.BAS ==================================
  2. '                       Quick Basic 4.5
  3. '             Copyright 1989 - Frederick Volking
  4. ' All Rights released to public domain by original author on 12/01/89
  5. '
  6. ' =====================================================================
  7. '
  8. ' This program displays the bit-map for a 16x16 pixel image stored
  9. ' with the graphics GET image command for Screen 9 - EGA color.
  10. '
  11. ' This program requires the function BITON.BAS be merged with it.
  12. '
  13. ' ==================================================================
  14. '  Author:       Frederick Volking
  15. '  Contact:      (415)952-3450 [home]          (415)378-4640 [work]
  16. '  USPO Mail:    425 Larch Avenue  -  South San Francisco, CA 94080
  17. '  EchoMail:     ANY Basic conference (I try to read them all)
  18. '  Library At:   QBCentral BBS - Vancouver Washington (206)892-7500
  19. ' ==================================================================
  20. DEFINT A-Z
  21. CLS
  22. SCREEN 9
  23. IntsNeeded = 66
  24. MaxClrs = 15
  25. DIM A(1 TO IntsNeeded)
  26.  
  27. FOR Clr = 1 TO MaxClrs
  28.    CLS
  29.    LINE (0, 0)-(15, 15), Clr, B
  30.    LINE (0, 0)-(15, 15), Clr
  31.    GET (0, 0)-(15, 15), A
  32.    LOCATE 1, 10: PRINT "Integers Used   = "; IntsNeeded
  33.    LOCATE 2, 10: PRINT "Array Element 1 = "; A(1)
  34.    LOCATE 3, 10: PRINT "Array Element 2 = "; A(2)
  35.    LOCATE 4, 10: PRINT "Color = "; Clr
  36.    PRINT
  37.  
  38.    FOR C = 3 TO IntsNeeded STEP 4
  39.  
  40.       FOR D = 0 TO 3
  41.  
  42.          B = C + D
  43.          FOR Bit = 1 TO 8
  44.             IF (BitOn(Bit, A(B))) THEN PRINT "1";  ELSE PRINT "0";
  45.          NEXT
  46.          PRINT " ";
  47.          FOR Bit = 9 TO 16
  48.             IF (BitOn(Bit, A(B))) THEN PRINT "1";  ELSE PRINT "0";
  49.          NEXT
  50.          PRINT "  ";
  51.       NEXT
  52.  
  53.       PRINT
  54.    NEXT
  55.  
  56.    DO: K$ = INKEY$: LOOP WHILE K$ = ""
  57.    IF K$ = CHR$(27) THEN
  58.       SCREEN 0, 0
  59.       CLS
  60.       END
  61.    END IF
  62. NEXT
  63.  
  64. SCREEN 0, 0
  65. CLS
  66. END